// javamaps
// Copyright (c) 2010 Vasiu Cristina

package Utils.PathFinder;
import Core.Node;
import java.util.Map;


public class Vertex implements Comparable {
    
   private Node node_;
   private Vertex previous_;
   private Double minDistance_;


    public Vertex(){
        node_ = null;
        previous_ = null;
        minDistance_ = Double.POSITIVE_INFINITY;

    }

    public Vertex(Node node){
        node_ = node;
        previous_ = null;
        minDistance_ = Double.POSITIVE_INFINITY;

    }

    public Vertex(Node node, Vertex previous, Double minDistance){

        node_ = node;
        previous_ = previous;
        minDistance_ = minDistance;


    }

   
    public Node Node() { return node_;} 
    public void SetNode(Node node) { node_ = node; }
   
    public Vertex Previous() { return previous_; }
    public void SetPrevious(Vertex previous) { previous_ = previous; }

    
    public Double MinDistance() { return minDistance_; }
    public void SetMinDistance(Double minDistance) {
        minDistance_ = minDistance;
    }

    public int compareTo(Object o) {
        Vertex other = (Vertex)o;

        if(other.minDistance_ < minDistance_) return -1;
        else if(other.minDistance_ > minDistance_) return 1;
        else return 0;
    }


}
